<?php
class block_1 extends Update_Model_Database_AbstractChange{

	protected $comment="Создание таблицы block";

	public function up(){
		$sql=
			'CREATE TABLE IF NOT EXISTS block(
	  			  id INT(11) NOT NULL AUTO_INCREMENT,
	  			  label TEXT DEFAULT NULL,
				  region TEXT DEFAULT NULL,
				  mvc_action TEXT NOT NULL,
				  mvc_module TEXT NOT NULL,
				  mvc_controller TEXT NOT NULL,
				  params TEXT DEFAULT NULL,
				  cache TINYINT(1) DEFAULT 1,
				  weight INT(11) NOT NULL DEFAULT 10,
				  date_start DATE DEFAULT NULL,
				  date_end DATE DEFAULT NULL,
				  active TINYINT(1) DEFAULT 1,
				  PRIMARY KEY (id)
			)
				CHARACTER SET utf8
				COLLATE utf8_general_ci;';
		$this->db->query($sql);
	}

	public function down(){
		$sql='DROP TABLE IF EXISTS block ;';
		$this->db->query($sql);
	}

}